<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>密码重置</title>
		<link rel='stylesheet' type='text/css' href='/static/view/css/common.css'>
		<link rel='stylesheet' type='text/css' href='/static/view/css/head.css'/>
	</head>
	<body>
		<include file="public:header"/>
		<div class='body'>
			<span class='title'>密码重置</span>
			<div class='body-infor'>
			<fieldset>
			<legend>密码重置</legend>
				<form action='/User/user/changePassword' method='post' id="change_password"> 
					<table cellspacing='10px'>
						<tr align='right'><th><label for='username'>用户名</label></th><td><input readonly id='username' class="input" type='text' name='username' autocomplete='on' value='<php>if($_GET["user_id"]&&$_SESSION["userInfo"]){echo $_SESSION["userInfo"]["username"];}</php>{$username}' placeholder='用户名' autofoucs required/></td><td></td></tr>
                                                <tr align='right'><th><label for='new_password'>新密码</label></th><td><input id='new_password' class="input" type='password' name='new_password' placeholder='新密码' required></td><td><span id="password_error"></span></td></tr>
						<tr align='right'><th><label for='confirm_password'>再次输入</label></th><td><input id='confirm_password' class="input" type='password' name='confirm_password' placeholder='再次输入' required/></td><td><span id="confirm_password_error"></span></td></tr>
						<tr align='left'><td></td><td><button type='submit'>提交</button>{$msg}</td></tr>	
					</table>	
				</form>
			</fieldset>
			</div>
		</div>
		<include file="public:footer"/>
	<script type='text/javascript' src='/static/view/js/jquery-1.8.3.js'></script>
	<script type='text/javascript'>
	
            $(document).ready(function(){

                    $('.title').click(function(){
                        $('div.body-infor').slideToggle('slow');
                    });
                    $('legend').click(function(){
                        $(this).next('form').slideToggle('fast');
                    });
                    
                    $('form#change_password').submit(function(){
                        var password=$.trim($('#new_password').val());
                        var confirm_password=$.trim($('#confirm_password').val());
                        if(password.length<3){
                            $('#password_error').html("<font color='red'>密码至少为三位</font>");
                            return false;
                        }
                        if(password!=confirm_password){
                            $('#confirm_password_error').html("<font color='red'>两次密码输入不一致</font>");
                            return false;
                        }
                    });

            });
	
	</script>
	</body>
</html>